const mongoose = require('mongoose')

const commentSchema = new mongoose.Schema({
    //文章id
    aid: {
        type: mongoose.Schema.Types.ObjectId,
        ref: 'Article',
    },
    //用户id
    uid: {
        type: mongoose.Schema.Types.ObjectId,
        ref: 'User',
    },
    time: {
        type: Date,
        default: Date.now

    },
    content: {
        type: String,
        default: null
    },
})

// 创建集合
const Comment = mongoose.model('Comment', commentSchema);

// 将用户集合做为模块成员进行导出
module.exports = {
    Comment
}